DataTable dt = new DataTable();
dt.Columns.Add("Name", typeof(string));
dt.Columns.Add("Age", typeof(string));
dt.Columns.Add("PHOTO", typeof(ImageSource));
for (int i = 0; i < 3; i )
{
byte[] imageBuffer = File.ReadAllBytes("d:\\1.bmp");
MemoryStream s = new MemoryStream(imageBuffer);
ImageSourceConverter imagesourceconverter = new ImageSourceConverter();
ImageSource img = (ImageSource)imagesourceconverter.ConvertFrom(s);
dt.Rows.Add("AAAA", "BBBB", img);
}
this.ASPNET.DataContext = dt;
评论